/* eslint-disable consistent-return */
/* eslint-disable react/react-in-jsx-scope */
import axios from 'axios';
import { routerRedux } from 'dva/router';
import moment from 'moment';
import cookie from './cookie';
import styles from './utils.less';

const global = {
  withoutPermission(dispatch) {
    if (!dispatch) {
      return null;
    }
    return dispatch(
      routerRedux.replace(
        `/team/${this.getCurrTeamName()}/region/${this.getCurrRegionName()}/Exception/403`
      )
    );
  },
  nFormatter(num, digits = 1) {
    const si = [
      { value: 1, symbol: '' },
      { value: 1e3, symbol: 'K' },
      { value: 1e6, symbol: 'M' },
      { value: 1e9, symbol: 'G' },
      { value: 1e12, symbol: 'T' },
      { value: 1e15, symbol: 'P' },
      { value: 1e18, symbol: 'E' }
    ];
    const rx = /\.0+$|(\.[0-9]*[1-9])0+$/;
    let i;
    for (i = si.length - 1; i > 0; i--) {
      if (num >= si[i].value) {
        break;
      }
    }
    return (num / si[i].value).toFixed(digits).replace(rx, '$1') + si[i].symbol;
  },
  removeCookie() {
    cookie.remove('team_name', { domain: '' });
    cookie.remove('region_name', { domain: '' });
    cookie.remove('team', { domain: '' });
    cookie.remove('token', { domain: '' });
    cookie.remove('appStore', { domain: '' });
    cookie.remove('newbie_guide', { domain: '' });
    cookie.remove('enterprise_edition', { domain: '' });
    cookie.remove('platform_url', { domain: '' });
  },
  putLog(info) {
    if (!info || (info && !info.enterprise_id)) {
      return null;
    }
    try {
      const defaultOptions = {
        credentials: 'same-origin'
      };
      const { title, version } = info;
      defaultOptions.url = 'https://log.appbase.store/log';
      defaultOptions.method = 'post';
      defaultOptions.data = JSON.stringify({
        url: window.location.href,
        eid: info.enterprise_id,
        e_name: info.enterprise_alias,
        version: version.value,
        title: title.value,
        day: moment(new Date())
          .locale('zh-cn')
          .format('YYYYMMDD')
      });
      defaultOptions.data = JSON.parse(defaultOptions.data);
      axios(defaultOptions);
    } catch (e) {}
  },
  getCurrEnterpriseId() {
    const reg = /enterprise\/([^\/]+)/;
    const hash = location.hash || '';
    const match = hash.match(reg);
    if (match) {
      return match[1];
    }
    return '';
  },
  getCurrTeamName() {
    const reg = /team\/([^\/]+)/;
    const hash = location.hash || '';
    const match = hash.match(reg);
    if (match) {
      return match[1];
    }
    return '';
  },
  getComponentID() {
    const reg = /components\/([^\/]+)/;
    const hash = location.hash || '';
    const match = hash.match(reg);
    if (match) {
      return match[1];
    }
    return '';
  },
  getAppID() {
    const reg = /apps\/([^\/]+)/;
    const hash = location.hash || '';
    const match = hash.match(reg);
    if (match) {
      return match[1];
    }
    return '';
  },
  getCurrRegionName() {
    const reg = /region\/([^\/]+)/;
    const hash = location.hash || '';
    const match = hash.match(reg);
    if (match) {
      return match[1];
    }
    return '';
  },
  fetchStateColor(status) {
    const statusColorMap = {
      RUNNING: '#00D777', // 运行中 绿色
      running: '#00D777', // 运行中 绿色
      starting: '#F69D4A', // 启动中
      Starting: '#F69D4A', // 启动中
      NOTREADY: '#F69D4A', // 未就绪
      checking: 'F69D4A', // 检测中
      SCHEDULING: '#F69D4A', // 检测中
      stopping: '#20124A', // 关闭中 紫色
      Stopping: '#20124A', // 关闭中 紫色
      unusual: '#CD0200', // 异常 纯红
      ABNORMAL: '#CD0200', // 异常 纯红
      closed: '#000021', // 已关闭 黑色
      Closed: '#000021', // 已关闭 黑色
      undeploy: '#708090', // 未部署 石板灰
      Undeploy: '#708090', // 未部署 石板灰
      Unknow: '#CD0200', // 未知深粉色
      unknow: '#CD0200', // 未知/深粉色
      Creating: '#778899', // 部署中 浅石板灰
      creating: '#778899', // 部署中 浅石板灰
      Third_party: '#5BB2FA',
      Internet: '#5BB2FA', // 蓝色
      TheInternet: '#5BB2FA', // 蓝色
      Abnormal: '#CD0200', // 不正常,纯红
      abnormal: '#CD0200', // 不正常,纯红
      Build_failure: '#CD0200', // 构建失败 纯红
      build_failure: '#CD0200', // 构建失败 纯红
      Upgrade: '#00FF4A', // 升级中
      upgrade: '#00FF4A', // 升级中
      expired: '#CD0200', // 过期 猩红
      Expired: '#CD0200', // 猩红
      UNHEALTHY: '#CD0200',
      INITIATING: '#F69D4A',
      TEMINATING: '#20124A', // 关闭中 紫色
      tEMINATING: '#20124A', // 关闭中 紫色
      Some_abnormal: '#FF0000', // 一些不正常 纯红
      Building: '#007710' // 构建  纯蓝
    };
    return statusColorMap[status] || statusColorMap.unknow;
  },
  confirmEnding(str, target) {
    return str.indexOf(target) > -1 || str.indexOf(target.toLowerCase()) > -1;
  },
  fetchSvg(type, color) {
    const svgType = {
      dockerSvg: (
        <svg viewBox="0 0 50 50" version="1.1" width="60px" height="60px">
          <path
            style={{ fill: '#03A9F4' }}
            d="M 40 20 C 40.390625 18.265625 39.90625 16.21875 37.5 14 C 33.585938 17.542969 34.703125 21.226563 36 23 C 36 23 35.835938 24 32 24 C 28.164063 24 2 24 2 24 C 2 24 0.167969 40 18 40 C 33.59375 40 37.972656 27.996094 38.828125 24.925781 C 39.183594 24.972656 39.578125 25.003906 40 25 C 42.148438 24.984375 44.929688 23.828125 46 19.515625 C 43.160156 18.53125 41.339844 18.976563 40 20 Z "
          />
          <path
            style={{ fill: '#0288D1' }}
            d="M 2.164063 28 C 2.898438 32.738281 5.984375 40 18 40 C 30.183594 40 35.523438 32.671875 37.683594 28 Z "
          />
          <path
            style={{ fill: '#81D4FA' }}
            d="M 19.8125 39.9375 C 18.890625 39.617188 14.738281 38.847656 14 33 C 9.789063 34.863281 6.0625 34.375 4.421875 34.007813 C 6.582031 37.238281 10.589844 40 18 40 C 18.621094 40 19.222656 39.976563 19.8125 39.9375 Z "
          />
          <path
            style={{ fill: '#FFFFFF' }}
            d="M 20 32 C 20 33.105469 19.105469 34 18 34 C 16.894531 34 16 33.105469 16 32 C 16 30.894531 16.894531 30 18 30 C 19.105469 30 20 30.894531 20 32 Z "
          />
          <path
            style={{ fill: '#37474F' }}
            d="M 14.914063 33.597656 C 15.136719 34.101563 14.933594 34.757813 14.402344 34.914063 C 11.101563 35.886719 8.257813 36.015625 6.105469 36.015625 C 5.464844 35.398438 4.914063 34.738281 4.449219 34.054688 C 7.035156 34.054688 11.160156 33.933594 13.59375 33.089844 C 14.117188 32.90625 14.691406 33.089844 14.914063 33.597656 Z M 2 27 C 2 27 3.875 27.125 5 26 C 6.875 27.6875 10.941406 27.089844 12 26 C 13.0625 27.6875 18.9375 27.375 20 26 C 21.25 27.4375 26.625 27.75 28 26 C 28.480469 27.460938 34.820313 27.875 36 26 C 37.0625 27.089844 41.0625 27.9375 43.3125 26 C 43.875 27.1875 46 27 46 27 L 46 28 L 2 28 M 17 32 C 17 32.550781 17.449219 33 18 33 C 18.550781 33 19 32.550781 19 32 C 19 31.449219 18.550781 31 18 31 C 17.449219 31 17 31.449219 17 32 Z "
          />
          <path
            style={{ fill: '#01579B' }}
            d="M 11 24 L 6 24 L 6 19 L 11 19 Z M 21 19 L 16 19 L 16 24 L 21 24 Z M 31 19 L 26 19 L 26 24 L 31 24 Z M 16 14 L 11 14 L 11 19 L 16 19 Z M 26 14 L 21 14 L 21 19 L 26 19 Z "
          />
          <path
            style={{ fill: '#0288D1' }}
            d="M 16 24 L 11 24 L 11 19 L 16 19 Z M 26 19 L 21 19 L 21 24 L 26 24 Z M 26 9 L 21 9 L 21 14 L 26 14 Z M 21 14 L 16 14 L 16 19 L 21 19 Z "
          />
        </svg>
      ),
      codeSvg: (
        <svg width="60px" height="60px" viewBox="0 0 50 50" version="1.1">
          <path
            d="M31.157459,0.325985833 C30.9361049,0.1167225 30.6431362,0 30.3385417,0 L10.5952381,0 C7.30933786,0.0037202381 4.64657738,2.66648071 4.64285714,5.95238095 L4.64285714,44.047619 C4.64657738,47.3335193 7.30933786,49.9962798 10.5952381,50 L39.4140625,50 C42.6999629,49.9962798 45.3627232,47.3335193 45.3664435,44.047619 L45.3664435,14.297805 C45.3664435,13.9708892 45.2320499,13.6583892 44.9944196,13.4333148 L31.157459,0.325985833 Z M31.7145648,4.13364952 L41.109561,13.0333892 L32.905041,13.0333892 C32.2479538,13.032459 31.7150298,12.5 31.7145648,11.842913 L31.7145648,4.13364952 Z M39.4140625,47.6190476 L10.5952381,47.6190476 C8.6235119,47.6167225 7.02613464,46.0193452 7.02380952,44.047619 L7.02380952,5.95238095 C7.02613464,3.98065476 8.6235119,2.3832775 10.5952381,2.38095238 L29.3331474,2.38095238 L29.3331474,11.842913 C29.3354725,13.814174 30.9333148,15.4120164 32.904576,15.4143415 L42.9850261,15.4143415 L42.9850261,44.047619 C42.983166,46.0188802 41.3853237,47.6167225 39.4140625,47.6190476 Z"
            id="Shape"
            fill="#006DF0"
            fillRule="nonzero"
          />
          <path
            d="M31.8708148,26.7089844 C31.5987724,26.3778832 31.1700149,26.218378 30.7477679,26.2913876 C30.3259858,26.3643974 29.9753535,26.6582962 29.8302642,27.0614769 C29.6851749,27.4646577 29.7679501,27.9143415 30.046968,28.2393974 L33.1180245,31.9001117 L30.046968,35.560826 C29.7679501,35.8858817 29.6851749,36.3360305 29.8302642,36.7392113 C29.9753535,37.1419271 30.3259858,37.436291 30.7477679,37.5088356 C31.1700149,37.5818452 31.5987724,37.42234 31.8708148,37.0912388 L35.5850074,32.6655506 C35.9561012,32.2228423 35.9561012,31.577381 35.5850074,31.1351376 L31.8708148,26.7089844 Z"
            id="Shape"
            fill="#006DF0"
            fillRule="nonzero"
          />
          <path
            d="M16.890811,31.9001117 L19.9623326,28.2393974 C20.2413505,27.9143415 20.3241257,27.4646577 20.1790364,27.0614769 C20.0339471,26.6582962 19.6833148,26.3643974 19.2610677,26.2913876 C18.8392857,26.218378 18.4105283,26.3778832 18.1384858,26.7089844 L14.4247582,31.1351376 C14.0536644,31.577381 14.0536644,32.2228423 14.4247582,32.6655506 L18.1384858,37.0912388 C18.4105283,37.42234 18.8392857,37.5818452 19.2610677,37.5088356 C19.6833148,37.436291 20.0339471,37.1419271 20.1790364,36.7392113 C20.3241257,36.3360305 20.2413505,35.8858817 19.9623326,35.560826 L16.890811,31.9001117 Z"
            id="Shape"
            fill="#006DF0"
            fillRule="nonzero"
          />
          <path
            d="M26.3020833,23.3468192 C25.6524368,23.2482329 25.0451079,23.6951264 24.9465215,24.3452381 L22.7087983,39.0978423 C22.609747,39.7479538 23.0571057,40.3548177 23.7072173,40.453404 C23.7667411,40.4627046 23.8267299,40.4673549 23.8871838,40.4673549 C24.4749814,40.4664249 24.9744233,40.0367374 25.062779,39.4554501 L27.3005023,24.702381 C27.3995536,24.0522693 26.952195,23.4454055 26.3020833,23.3468192 Z"
            id="Shape"
            fill="#006DF0"
            fillRule="nonzero"
          />
        </svg>
      ),
      defaulAppImg: (
        <svg width="50" height="50" viewBox="0 0 50 50">
          <g
            id="我的机构-应用市场"
            stroke="none"
            strokeWidth="1"
            fill="none"
            fillRule="evenodd"
          >
            <g
              id="组件库"
              transform="translate(-195.000000, -313.000000)"
              fillRule="nonzero"
            >
              <g id="编组" transform="translate(195.000000, 313.000000)">
                <path
                  d="M45.3191208,0.0441384181 L4.50211864,0.0441384181 C2.02484993,0.0441384181 0,2.06898835 0,4.54625706 L0,45.3632592 C0,47.8405279 2.02484993,49.8653778 4.50211864,49.8653778 L45.3191208,49.8653778 C47.7963895,49.8653778 49.8212394,47.8405279 49.8212394,45.3632592 L49.8212394,4.54625706 C49.8212394,2.06898835 47.7908722,0.0441384181 45.3191208,0.0441384181 Z"
                  id="路径"
                  fill="#60A44E"
                />
                <path
                  d="M24.9106197,44.9660134 C22.2071416,44.9660134 19.586423,44.4363524 17.1201889,43.3935823 C14.7367143,42.383916 12.5960011,40.9439001 10.7587394,39.1066384 C8.92147775,37.2693768 7.47594456,35.1286635 6.47179555,32.7451889 C5.42902542,30.2789548 4.89936441,27.6582362 4.89936441,24.9547581 C4.89936441,22.25128 5.42902542,19.6305614 6.47179555,17.1643273 C7.48146186,14.7808528 8.92147775,12.6401395 10.7587394,10.8028778 C12.5960011,8.96561617 14.7367143,7.52008298 17.1201889,6.51593397 C19.586423,5.47316384 22.2071416,4.94350282 24.9106197,4.94350282 C27.6140978,4.94350282 30.2348164,5.47316384 32.7010505,6.51593397 C35.0845251,7.52560028 37.2252383,8.96561617 39.0625,10.8028778 C40.8997617,12.6401395 42.3452948,14.7808528 43.3494439,17.1643273 C44.392214,19.6305614 44.921875,22.25128 44.921875,24.9547581 C44.921875,27.6582362 44.392214,30.2789548 43.3494439,32.7451889 C42.3397775,35.1286635 40.8997617,37.2693768 39.0625,39.1066384 C37.2252383,40.9439001 35.0845251,42.3894333 32.7010505,43.3935823 C30.2292991,44.4363524 27.6085805,44.9660134 24.9106197,44.9660134 Z M24.9106197,6.03041137 C14.4774011,6.03041137 5.98627295,14.5160222 5.98627295,24.9547581 C5.98627295,35.393494 14.4718838,43.8791049 24.9106197,43.8791049 C35.3493556,43.8791049 43.8349665,35.393494 43.8349665,24.9547581 C43.8349665,14.5160222 35.3438383,6.03041137 24.9106197,6.03041137 Z"
                  id="形状"
                  fill="#FFFFFF"
                />
                <path
                  d="M22.7202507,23.1395657 L16.5960452,23.1395657 C15.9670727,23.1395657 15.4539636,22.6264566 15.4539636,21.9974841 L15.4539636,17.1753619 C15.4539636,16.5463895 15.9670727,16.0332804 16.5960452,16.0332804 L22.7202507,16.0332804 C23.3492232,16.0332804 23.8623323,16.5463895 23.8623323,17.1753619 L23.8623323,21.9974841 C23.8623323,22.6264566 23.3492232,23.1395657 22.7202507,23.1395657 L22.7202507,23.1395657 Z M16.5960452,16.756047 C16.3643185,16.756047 16.1822475,16.9436352 16.1822475,17.1698446 L16.1822475,21.9919668 C16.1822475,22.2236935 16.3698358,22.4057645 16.5960452,22.4057645 L22.7202507,22.4057645 C22.9519774,22.4057645 23.1340484,22.2181762 23.1340484,21.9919668 L23.1340484,17.1698446 C23.1340484,16.9381179 22.9464601,16.756047 22.7202507,16.756047 L16.5960452,16.756047 L16.5960452,16.756047 Z"
                  id="形状"
                  fill="#FFFFFF"
                />
                <path
                  d="M17.0981197,30.2568856 C16.8057027,30.2568856 16.5132857,30.1465395 16.2925936,29.9258475 L12.8829008,26.5161547 C12.667726,26.3009799 12.5518626,26.0140802 12.5518626,25.7106285 C12.5518626,25.4071769 12.667726,25.1202772 12.8829008,24.9051024 L17.2139831,20.5740201 C17.4291578,20.3588453 17.7160576,20.242982 18.0195092,20.242982 C18.3229608,20.242982 18.6098605,20.3588453 18.8250353,20.5740201 L22.2347281,23.9837129 C22.4499029,24.1988877 22.5657662,24.4857874 22.5657662,24.7892391 C22.5657662,25.0926907 22.4499029,25.3795904 22.2347281,25.5947652 L17.9036458,29.9258475 C17.6829537,30.1465395 17.3905367,30.2568856 17.0981197,30.2568856 L17.0981197,30.2568856 Z M18.0139919,20.9602313 C17.9091631,20.9602313 17.7988171,20.9988524 17.7215749,21.0816119 L13.3904926,25.4126942 C13.2304908,25.572696 13.2304908,25.8375265 13.3904926,26.0030456 L16.8001854,29.4127383 C16.9601871,29.5727401 17.2250177,29.5727401 17.3905367,29.4127383 L21.721619,25.0816561 C21.8816208,24.9216543 21.8816208,24.6568238 21.721619,24.4913047 L18.3119262,21.0816119 C18.2291667,20.9988524 18.1243379,20.9602313 18.0139919,20.9602313 L18.0139919,20.9602313 Z"
                  id="形状"
                  fill="#FFFFFF"
                />
                <path
                  d="M22.4830067,34.9355579 L17.6608845,34.9355579 C17.0319121,34.9355579 16.518803,34.4224488 16.518803,33.7934763 L16.518803,27.6692708 C16.518803,27.0402984 17.0319121,26.5271893 17.6608845,26.5271893 L22.4830067,26.5271893 C23.1119792,26.5271893 23.6250883,27.0402984 23.6250883,27.6692708 L23.6250883,33.7934763 C23.6250883,34.4279661 23.1119792,34.9355579 22.4830067,34.9355579 Z M17.6608845,27.2554732 C17.4291578,27.2554732 17.2470869,27.4430614 17.2470869,27.6692708 L17.2470869,33.7934763 C17.2470869,34.025203 17.4346751,34.207274 17.6608845,34.207274 L22.4830067,34.207274 C22.7147334,34.207274 22.8968044,34.0196857 22.8968044,33.7934763 L22.8968044,27.6692708 C22.8968044,27.4375441 22.7092161,27.2554732 22.4830067,27.2554732 L17.6608845,27.2554732 Z"
                  id="形状"
                  fill="#FFFFFF"
                />
                <path
                  d="M26.1906338,37.8486935 C25.8871822,37.8486935 25.6002825,37.7328302 25.3851077,37.5176554 L21.0540254,33.1865731 C20.6071239,32.7396716 20.6071239,32.016905 21.0540254,31.5755208 L24.4637182,28.165828 C24.678893,27.9506532 24.9657927,27.8347899 25.2692444,27.8347899 C25.572696,27.8347899 25.8595957,27.9506532 26.0747705,28.165828 L30.4058528,32.4969103 C30.6210275,32.7120851 30.7368909,32.9989848 30.7368909,33.3024364 C30.7368909,33.6058881 30.6210275,33.8927878 30.4058528,34.1079626 L26.99616,37.5176554 C26.7809852,37.7328302 26.4940855,37.8486935 26.1906338,37.8486935 L26.1906338,37.8486935 Z M25.2692444,28.5520392 C25.1644156,28.5520392 25.0540696,28.5906603 24.9768273,28.6734198 L21.5671345,32.0831126 C21.4071328,32.2431144 21.4071328,32.5079449 21.5671345,32.673464 L25.8982168,37.0045463 C25.975459,37.0817885 26.0802878,37.1259269 26.1906338,37.1259269 C26.3009799,37.1259269 26.4058086,37.0817885 26.4830508,37.0045463 L29.8927436,33.5948535 C29.9699859,33.5176112 30.0141243,33.4127825 30.0141243,33.3024364 C30.0141243,33.1920904 29.9699859,33.0872617 29.8927436,33.0100194 L25.5616614,28.6789371 C25.4844191,28.5906603 25.3795904,28.5520392 25.2692444,28.5520392 L25.2692444,28.5520392 Z"
                  id="形状"
                  fill="#FFFFFF"
                />
                <path
                  d="M34.2789989,33.8762359 L28.1547934,33.8762359 C27.525821,33.8762359 27.0127119,33.3631268 27.0127119,32.7341543 L27.0127119,27.9120321 C27.0127119,27.2830597 27.525821,26.7699506 28.1547934,26.7699506 L34.2789989,26.7699506 C34.9079714,26.7699506 35.4210805,27.2830597 35.4210805,27.9120321 L35.4210805,32.7341543 C35.4210805,33.3631268 34.9079714,33.8762359 34.2789989,33.8762359 Z M28.1603107,27.4927172 C27.928584,27.4927172 27.7465131,27.6803054 27.7465131,27.9065148 L27.7465131,32.728637 C27.7465131,32.9603637 27.9341013,33.1424347 28.1603107,33.1424347 L34.2845162,33.1424347 C34.5162429,33.1424347 34.6983139,32.9548464 34.6983139,32.728637 L34.6983139,27.9065148 C34.6983139,27.6747881 34.5107256,27.4927172 34.2845162,27.4927172 L28.1603107,27.4927172 Z"
                  id="形状"
                  fill="#FFFFFF"
                />
                <path
                  d="M32.8610523,29.6720516 C32.5686352,29.6720516 32.2762182,29.5617055 32.0555261,29.3410134 L28.6458333,25.9313206 C28.4306585,25.7161458 28.3147952,25.4292461 28.3147952,25.1257945 C28.3147952,24.8223429 28.4306585,24.5354431 28.6458333,24.3202684 L32.9769156,19.9891861 C33.1920904,19.7740113 33.4789901,19.658148 33.7824417,19.658148 C34.0858934,19.658148 34.3727931,19.7740113 34.5879679,19.9891861 L37.9976607,23.3988789 C38.4445621,23.8457804 38.4445621,24.568547 37.9976607,25.0099311 L33.6665784,29.3410134 C33.4458863,29.5617055 33.1534693,29.6720516 32.8610523,29.6720516 Z M33.7824417,20.3753972 C33.677613,20.3753972 33.5672669,20.4140184 33.4900247,20.4967779 L29.1589424,24.8278602 C28.9989407,24.9878619 28.9989407,25.2526924 29.1589424,25.4182115 L32.5686352,28.8279043 C32.728637,28.9879061 32.9934675,28.9879061 33.1589866,28.8279043 L37.4900689,24.496822 C37.6500706,24.3368203 37.6500706,24.0719898 37.4900689,23.9064707 L34.0803761,20.4967779 C33.9976165,20.4195357 33.8872705,20.3753972 33.7824417,20.3753972 L33.7824417,20.3753972 Z"
                  id="形状"
                  fill="#FFFFFF"
                />
                <path
                  d="M33.2196769,23.3768097 L28.3975547,23.3768097 C27.7685823,23.3768097 27.2554732,22.8637006 27.2554732,22.2347281 L27.2554732,16.1105226 C27.2554732,15.4815501 27.7685823,14.968441 28.3975547,14.968441 L33.2196769,14.968441 C33.8486494,14.968441 34.3617585,15.4815501 34.3617585,16.1105226 L34.3617585,22.2347281 C34.3617585,22.8637006 33.8486494,23.3768097 33.2196769,23.3768097 Z M28.3975547,15.6967249 C28.165828,15.6967249 27.9837571,15.8843132 27.9837571,16.1105226 L27.9837571,22.2347281 C27.9837571,22.4664548 28.1713453,22.6485258 28.3975547,22.6485258 L33.2196769,22.6485258 C33.4514036,22.6485258 33.6334746,22.4609375 33.6334746,22.2347281 L33.6334746,16.1105226 C33.6334746,15.8787959 33.4458863,15.6967249 33.2196769,15.6967249 L28.3975547,15.6967249 Z"
                  id="形状"
                  fill="#FFFFFF"
                />
                <path
                  d="M25.6057998,22.0802436 C25.3023482,22.0802436 25.0154484,21.9643803 24.8002737,21.7492055 L20.4691914,17.4181232 C20.2540166,17.2029484 20.1381532,16.9160487 20.1381532,16.6125971 C20.1381532,16.3091455 20.2540166,16.0222458 20.4691914,15.807071 L23.8788842,12.3973782 C24.094059,12.1822034 24.3809587,12.06634 24.6844103,12.06634 C24.9878619,12.06634 25.2747617,12.1822034 25.4899364,12.3973782 L29.8210187,16.7284605 C30.0361935,16.9436352 30.1520569,17.230535 30.1520569,17.5339866 C30.1520569,17.8374382 30.0361935,18.1243379 29.8210187,18.3395127 L26.4113259,21.7492055 C26.2016684,21.9643803 25.9147687,22.0802436 25.6057998,22.0802436 Z M24.6899276,12.7835893 C24.5850989,12.7835893 24.4747528,12.8222105 24.3975106,12.90497 L20.9878178,16.3146628 C20.827816,16.4746645 20.827816,16.7394951 20.9878178,16.9050141 L25.3189001,21.2360964 C25.3961423,21.3133386 25.500971,21.357477 25.6113171,21.357477 C25.7216631,21.357477 25.8264919,21.3133386 25.9037341,21.2360964 L29.3134269,17.8264036 C29.4734287,17.6664018 29.4734287,17.4015713 29.3134269,17.2360523 L24.9823446,12.90497 C24.9051024,12.8277278 24.7947564,12.7835893 24.6899276,12.7835893 L24.6899276,12.7835893 Z M25.4402807,27.2554732 C24.1713012,27.2554732 23.1395657,26.2237376 23.1395657,24.9547581 C23.1395657,23.6857786 24.1713012,22.6540431 25.4402807,22.6540431 C26.7092602,22.6540431 27.7409958,23.6857786 27.7409958,24.9547581 C27.7409958,26.2237376 26.7092602,27.2554732 25.4402807,27.2554732 Z M25.4402807,23.3768097 C24.568547,23.3768097 23.8623323,24.0830244 23.8623323,24.9547581 C23.8623323,25.8264919 24.568547,26.5327066 25.4402807,26.5327066 C26.3120145,26.5327066 27.0182292,25.8264919 27.0182292,24.9547581 C27.0182292,24.0830244 26.3120145,23.3768097 25.4402807,23.3768097 L25.4402807,23.3768097 Z"
                  id="形状"
                  fill="#FFFFFF"
                />
              </g>
            </g>
          </g>
        </svg>
      ),
      vip: (
        <svg
          t="1585818847140"
          viewBox="0 0 1024 1024"
          p-id="2821"
          width="20"
          height="20"
        >
          <path
            d="M1007.669 323.675c0.481 8.367-2.411 16.732-8.204 23.327l-480.066 548.598 359.083-571.927h129.185z"
            fill="#2EB9EF"
            p-id="2822"
          />
          <path
            d="M1007.669 323.675h-129.185l-55.985-204.317c11.584 0.803 22.363 6.275 30.086 15.124l147.045 168.442c5.149 5.953 7.885 13.354 8.043 20.754z"
            fill="#44C9F2"
            p-id="2823"
          />
          <path
            d="M822.497 119.357l55.985 204.317h-166.189l-32.821-73.039 139.162-131.599c1.286 0 2.572 0 3.861 0.324z"
            fill="#2EB9EF"
            p-id="2824"
          />
          <path
            d="M878.484 323.675l-359.083 571.927 192.895-571.927zM818.636 119.036l-139.162 131.599-160.075-131.599z"
            fill="#46D3F9"
            p-id="2825"
          />
          <path
            d="M679.476 250.636l32.821 73.039h-192.895v-204.64z"
            fill="#5CD6F7"
            p-id="2826"
          />
          <path
            d="M712.295 323.675l-192.895 571.927v-571.927h7.241z"
            fill="#76E5FF"
            p-id="2827"
          />
          <path
            d="M519.241 323.675v571.927l-192.895-571.927h185.654z"
            fill="#3FC1EF"
            p-id="2828"
          />
          <path
            d="M519.241 119.036v204.64h-192.895l32.821-73.039z"
            fill="#76E5FF"
            p-id="2829"
          />
          <path
            d="M326.346 323.675l192.895 571.927-359.243-571.927z"
            fill="#46D3F9"
            p-id="2830"
          />
          <path
            d="M159.995 323.675l359.243 571.927-480.226-548.598c-5.791-6.595-8.687-14.961-8.204-23.327h129.185z"
            fill="#2EB9EF"
            p-id="2831"
          />
          <path
            d="M519.241 119.036l-160.075 131.599-139.321-131.599z"
            fill="#46D3F9"
            p-id="2832"
          />
          <path
            d="M359.164 250.636l-32.821 73.039h-166.35l55.985-204.317c1.286-0.324 2.572-0.324 3.861-0.324l139.321 131.599z"
            fill="#2EB9EF"
            p-id="2833"
          />
          <path
            d="M215.982 119.357l-55.985 204.317h-129.185c0.16-7.399 3.057-14.801 8.204-20.754l147.045-168.442c7.724-8.847 18.5-14.319 29.923-15.124z"
            fill="#44C9F2"
            p-id="2834"
          />
        </svg>
      ),
      free: (
        <svg
          t="1585879598597"
          viewBox="0 0 1025 1024"
          p-id="7186"
          width="18"
          height="18"
        >
          <path
            d="M1021.747 356.557l-2.355 2.253-493.67 658.33-4.608 4.607h-2.253c-1.536 1.536-3.789 2.253-6.861 2.253-3.072 0-5.325-0.717-6.86-2.253h-2.254l-4.608-4.608L4.608 358.81c-1.536 0-2.253-0.716-2.253-2.252v-2.253C0.717 352.768 0 351.232 0 349.696v-6.861l2.253-2.253c0-1.433 0.717-3.072 2.253-4.608v-2.252l256-256c3.072-1.434 5.324-2.253 6.86-2.253 1.536-1.434 3.79-2.253 6.861-2.253H749.67c3.072 0 5.325 0.82 6.861 2.253 1.536 0 3.072 0.819 4.608 2.253h2.253l256 256c1.536 3.072 2.253 5.324 2.253 6.86l2.355 2.253v6.861l-2.253 4.608v2.253z m-966.86 9.113L452.607 896l-192-530.33H54.886zM256 134.86L61.747 329.115H256V134.86z m214.835-25.19H292.557v192l178.278-192z m-171.417 256L512 950.886l212.582-585.113H299.418z m409.19-36.556L512 118.886 315.392 329.114h393.216z m22.835-219.444H553.165l178.278 192v-192zM571.392 896l397.722-530.33H763.392l-192 530.33z m390.86-566.886L768 134.86v194.253h194.253z"
            p-id="7187"
            fill="#ffffff"
          />
        </svg>
      ),
      cloudMarket: (
        <svg
          t="1592977834590"
          viewBox="0 0 1024 1024"
          p-id="15784"
          width="14"
          height="14"
        >
          <path
            d="M832 128 192 128C153.6 128 128 153.6 128 192l0 448c0 38.4 25.6 64 64 64l640 0c38.4 0 64-25.6 64-64L896 192C896 153.6 870.4 128 832 128zM864 614.4c0 32-25.6 57.6-57.6 57.6L217.6 672c-32 0-57.6-25.6-57.6-57.6L160 217.6c0-32 25.6-57.6 57.6-57.6l588.8 0c32 0 57.6 25.6 57.6 57.6L864 614.4z"
            p-id="15785"
            fill="#2c2c2c"
          />
          <path
            d="M640 832 608 832l0-128-192 0 0 128L384 832c-19.2 0-32 12.8-32 32C352 883.2 364.8 896 384 896l32 0 192 0L640 896c19.2 0 32-12.8 32-32C672 844.8 659.2 832 640 832z"
            p-id="15786"
            fill="#2c2c2c"
          />
          <path
            d="M736 268.8c-19.2 0-32 12.8-32 32 0 6.4 0 6.4 0 12.8L595.2 473.6c0 0 0 0-6.4 0-6.4 0-6.4 0-12.8 0L448 352c0 0 0-6.4 0-6.4 0-19.2-12.8-32-32-32C403.2 313.6 384 326.4 384 345.6c0 6.4 0 6.4 0 12.8L288 499.2c0 0 0 0 0 0C268.8 499.2 256 512 256 531.2c0 19.2 12.8 32 32 32S320 544 320 531.2c0-6.4 0-6.4 0-12.8l96-140.8c0 0 6.4 0 6.4 0 6.4 0 6.4 0 6.4 0l134.4 128c0 0 0 6.4 0 6.4 0 19.2 12.8 32 32 32s32-12.8 32-32c0-6.4 0-6.4 0-12.8l108.8-160c0 0 0 0 0 0C755.2 332.8 768 320 768 300.8 768 288 755.2 268.8 736 268.8z"
            p-id="15787"
            fill="#2c2c2c"
          />
        </svg>
      ),
      localMarket: (
        <svg
          t="1592977601179"
          viewBox="0 0 1024 1024"
          p-id="13469"
          width="14"
          height="14"
        >
          <path
            d="M721.9 94.2H302c-104.7 0-190 85.1-190 189.9v455.7c0 104.7 85.2 190 190 190h420c104.7 0 190-85.2 190-190V284.1c-0.1-104.8-85.3-189.9-190.1-189.9z m139.6 645.6c0 77-62.6 139.6-139.6 139.6H302c-77-0.1-139.6-62.7-139.6-139.6V284.1c0-77 62.6-139.6 139.6-139.6h420c77 0 139.6 62.6 139.6 139.6l-0.1 455.7z"
            p-id="13470"
            fill="#2c2c2c"
          />
          <path
            d="M642.5 354.9c-17.3 0-31.5 14.1-31.5 31.5 0 54.7-44.4 99.1-99.1 99.1s-99.1-44.4-99.1-99.1c0-17.3-14.1-31.5-31.5-31.5-17.3 0-31.5 14.1-31.5 31.5 0 89.4 72.7 162 162 162s162-72.7 162-162c0.2-17.5-13.9-31.5-31.3-31.5z"
            p-id="13471"
            fill="#2c2c2c"
          />
        </svg>
      ),
      uploads: (
        <svg viewBox="0 0 1024 1024" width="20" height="20">
          <path
            d="M983.679573 673.706667a26.88 26.88 0 0 0-27.093333 26.88v269.226666H67.412907V700.586667a26.666667 26.666667 0 0 0-26.88-26.88A27.093333 27.093333 0 0 0 13.439573 700.586667v296.32A27.093333 27.093333 0 0 0 40.532907 1024h942.933333a27.093333 27.093333 0 0 0 27.093333-27.093333V700.586667a26.666667 26.666667 0 0 0-26.88-26.88z"
            fill="#ffffff"
            p-id="2272"
          />
          <path
            d="M235.94624 342.826667L487.46624 91.306667v690.133333a27.093333 27.093333 0 0 0 53.973333 0V91.52l251.306667 251.306667a26.24 26.24 0 1 0 37.12-37.12L537.599573 13.226667a29.44 29.44 0 0 0-4.266666-5.333334 26.026667 26.026667 0 0 0-8.533334-5.76 29.653333 29.653333 0 0 0-10.666666-2.133333 28.586667 28.586667 0 0 0-10.453334 2.133333 26.026667 26.026667 0 0 0-8.746666 5.76 46.72 46.72 0 0 0-4.266667 5.333334L198.82624 305.706667a25.813333 25.813333 0 0 0 0 37.12 26.24 26.24 0 0 0 37.12 0z"
            fill="#ffffff"
            p-id="2273"
          />
        </svg>
      ),
      amplifications: (
        <svg viewBox="0 0 1024 1024" width="20" height="20">
          <path
            d="M537.7 420.2l277.8-287.9H557.9V64H928v377.1h-65.9V180.6l-277.8 288-46.6-48.4z m0 0M161.9 582.9v260.5l277.8-287.9 46.6 48.3-277.8 287.9h257.6V960H96V582.9h65.9z m0 0"
            fill="#ffffff"
            p-id="3232"
          />
        </svg>
      ),
      passwordShow: (
        <svg
          viewBox="64 64 896 896"
          focusable="false"
          data-icon="eye"
          width="1em"
          height="1em"
          fill="currentColor"
          aria-hidden="true"
        >
          <path d="M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 0 0 0 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z" />
        </svg>
      ),
      passwordHidden: (
        <svg
          viewBox="64 64 896 896"
          focusable="false"
          data-icon="eye-invisible"
          width="1em"
          height="1em"
          fill="currentColor"
          aria-hidden="true"
        >
          <path d="M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 0 0 0-51.5zm-63.57-320.64L836 122.88a8 8 0 0 0-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 0 0 0 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 0 0 0 11.31L155.17 889a8 8 0 0 0 11.31 0l712.15-712.12a8 8 0 0 0 0-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 0 0-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 0 1 146.2-106.69L401.31 546.2A112 112 0 0 1 396 512z" />
          <path d="M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 0 0 227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 0 1-112 112z" />
        </svg>
      ),
      application: (
        <svg
          width="40px"
          height="40px"
          viewBox="0 0 40 40"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
        >
          <g
            id="我的应用-总览"
            stroke="none"
            strokeWidth="1"
            fill="none"
            fillRule="evenodd"
          >
            <g
              id="我的应用"
              transform="translate(-101.000000, -117.000000)"
              fill="#1296DB"
              fillRule="nonzero"
            >
              <g id="编组" transform="translate(101.000000, 117.000000)">
                <path
                  d="M9.27551722,7.01349432e-05 C4.15848335,7.01349432e-05 0.00372962536,4.15803094 0.00372962536,9.27522519 C0.00372962536,14.3970696 4.15607808,18.5502199 9.27808287,18.5502199 L15.7098533,18.5502199 C17.2789103,18.5502199 18.5471445,17.2734869 18.5471445,15.7045903 L18.5471445,9.27265953 C18.5465031,4.15161683 14.3967203,7.01349432e-05 9.27551722,7.01349432e-05 Z M15.7082498,15.7045903 L15.7082498,15.7057128 C15.7090635,15.7077954 15.709707,15.7099404 15.7101741,15.7121495 L9.27808287,15.7121495 C6.66819785,15.7190058 4.31161857,14.1517228 3.30882288,11.7421693 C2.30602718,9.3326158 2.85485729,6.55617427 4.69901995,4.70939024 C6.5431826,2.86260621 9.31884175,2.3098329 11.7298172,3.30920497 C14.1407927,4.30857703 15.7114215,6.66292771 15.7082498,9.27281987 L15.7082498,15.7045903 Z M15.709212,21.2281198 L9.27808287,21.2281198 C4.15687984,21.2281198 0.00533314098,25.3791854 0.00533314098,30.5003884 C0.00533314098,35.6174223 4.15848335,39.7729778 9.27631898,39.7729778 C14.397522,39.7729778 18.5473048,35.6212708 18.5473048,30.5000677 L18.5473048,24.0682973 C18.5465031,22.49908 17.2781085,21.2281198 15.709212,21.2281198 Z M15.7082498,30.4999074 C15.7109758,33.0857609 14.1631833,35.4212282 11.7805563,36.4260839 C10.9892128,36.7607413 10.1471977,36.9267069 9.27808287,36.9267069 C8.40960946,36.9267069 7.56823575,36.7607413 6.77657156,36.4257632 C3.95286702,35.2383149 2.35859126,32.2240658 2.96625896,29.2217199 C3.57392665,26.219374 6.21486164,24.0623215 9.27808287,24.0662605 L15.7109758,24.0662605 C15.7103432,24.0662605 15.7096842,24.0662605 15.7090516,24.0662605 L15.7090516,30.499266 L15.7082498,30.4999074 Z M30.5442966,21.2281197 L24.1125261,21.2281197 C23.3592546,21.2281197 22.6367863,21.5271102 22.1041428,22.0597536 C21.5714994,22.592397 21.2725089,23.3148654 21.2725089,24.0681369 L21.2725089,30.4999074 C21.2725089,35.6211104 25.4235746,39.7726571 30.5447777,39.7726571 C35.6618115,39.7726571 39.817367,35.6174223 39.817367,30.5003884 C39.817367,25.3791854 35.6654996,21.2281197 30.5442966,21.2281197 L30.5442966,21.2281197 Z M36.4740009,33.001098 C35.2861041,35.825365 32.2712244,37.4199679 29.2681632,36.8123446 C26.265102,36.2047214 24.1072761,33.5635009 24.110758,30.4995867 L24.110758,24.066373 L30.5436552,24.066373 C32.6998426,24.0667719 34.7125897,25.1468281 35.9049864,26.9433063 C37.0973832,28.7397846 37.3110022,31.0139963 36.4740009,33.001098 L36.4740009,33.001098 Z M24.1125261,18.5502199 L30.5442966,18.5502199 C35.6654996,18.5502199 39.8170463,14.3970696 39.8170463,9.27506481 C39.8170463,4.15803094 35.6618115,0.00119264915 30.5447777,0.00119264915 C25.4235746,0.00119264915 21.272509,4.1514565 21.272509,9.27265953 L21.272509,15.70443 C21.272509,17.2734869 22.5434692,18.5502199 24.1125261,18.5502199 L24.1125261,18.5502199 Z M24.1107623,9.27265953 C24.1135957,5.71974823 26.9956581,2.84160943 30.54857,2.84361507 C34.1014819,2.8456228 36.9802913,5.72701533 36.9791118,9.27992757 C36.9779315,12.8328398 34.097209,15.7123197 30.5442966,15.7119666 L24.1107623,15.7119666 C24.1105385,15.709839 24.1105385,15.7076801 24.1107623,15.7055525 L24.1107623,9.27265953 L24.1107623,9.27265953 Z"
                  id="形状"
                />
              </g>
            </g>
          </g>
        </svg>
      ),
      component: (
        <svg
          t="1582714685365"
          className="icon"
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="2601"
          width="40"
          height="40"
        >
          <path
            d="M64 64h384v384H64V64z m0 512h384v384H64V576z m512 0h384v384H576V576z m192-128c106.039 0 192-85.961 192-192S874.039 64 768 64s-192 85.961-192 192 85.961 192 192 192z"
            p-id="2602"
            fill="#1296db"
          />
        </svg>
      ),
      logs: (
        <svg
          style={{
            cursor: 'pointer'
          }}
          t="1566527207023"
          className={styles.iconm}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="5957"
          width="16"
          height="16"
        >
          <path
            d="M902.8 892l-95.5-96.3c62.4-95.5 35.6-223.5-59.9-285.9s-223.5-35.6-285.9 59.9-35.6 223.5 59.9 285.9c33.7 22 73.1 33.7 113.4 33.6 40.6-0.1 80.3-12.2 114-34.8l95.6 96.2c11.9 11.9 31.3 11.9 43.2 0l15.3-15.4c11.9-12.1 11.9-31.4 0-43.5l-0.1 0.3zM746.4 734.6C732 765 706 788.3 674.2 799.3c-12.7 5-26.2 7.4-39.8 6.9-69.6 1-126.7-54.6-127.7-124.2S561.4 555.3 631 554.3 757.7 609 758.6 678.5c0.3 19.5-4 38.7-12.4 56.2l0.2-0.1zM364.6 720H263.4c-17.5-0.7-31.2-15.5-30.5-33 0.7-16.6 13.9-29.8 30.5-30.5H363c2.5-29.2 9.8-57.8 21.4-84.6H263.5c-17.5-0.7-31.2-15.5-30.5-33 0.7-16.6 13.9-29.8 30.5-30.5h159.3c31.1-38.5 72.1-67.8 118.6-84.6H263.5c-17.5 0-31.8-14.2-31.7-31.8 0-17.5 14.2-31.7 31.7-31.7H749c17.5 0 31.8 14.2 31.7 31.8 0 17.5-14.2 31.7-31.7 31.7h-23.8c85.9 31.3 150.5 103.6 171.9 192.6V160.1c0.1-52.9-42.7-96-95.6-96.3H210.8c-52.9 0.4-95.5 43.3-95.5 96.2v687c0 52.9 42.7 95.9 95.6 96.2h346.4C455 912.9 379.7 825.7 364.6 720zM263.4 212.2H749c17.5 0.7 31.2 15.5 30.5 33-0.7 16.6-13.9 29.8-30.5 30.5H263.4c-17.5-0.7-31.2-15.5-30.5-33 0.7-16.6 14-29.8 30.5-30.5z"
            fill={color || '#000'}
            p-id="5958"
          />
        </svg>
      ),
      runTime: (
        <svg
          t="1567065687158"
          className={styles.iconm}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="19354"
          width="12"
          height="12"
        >
          <path
            d="M874.057143 150.016A508.635429 508.635429 0 0 0 512.073143 0.146286c-136.704 0-265.216 53.248-361.837714 149.942857A508.489143 508.489143 0 0 0 0.292571 512c0 136.777143 53.174857 265.289143 149.869715 362.057143A508.635429 508.635429 0 0 0 512 1023.780571c136.777143 0 265.362286-53.321143 362.057143-149.942857 199.533714-199.533714 199.606857-524.288 0-723.894857z m-49.444572 674.377143A439.296 439.296 0 0 1 512 954.075429a439.149714 439.149714 0 0 1-312.466286-129.462858A439.076571 439.076571 0 0 1 70.217143 512c0-118.052571 45.933714-229.083429 129.462857-312.539429A439.003429 439.003429 0 0 1 512 70.070857c118.125714 0 229.083429 45.933714 312.539429 129.462857a442.514286 442.514286 0 0 1 0 624.932572zM544.036571 535.186286V256.073143c0-23.552-11.410286-46.226286-34.962285-46.226286-23.552 0-38.034286 22.674286-38.034286 46.226286v298.569143c0 24.356571 30.281143 35.401143 51.638857 50.029714 14.262857 9.728 67.291429 41.837714 159.158857 96.329143 20.772571 10.825143 52.077714 25.088 65.682286 2.925714 13.531429-22.016-9.654857-45.933714-32.694857-60.708571-15.36-9.874286-72.265143-45.933714-170.788572-108.105143z"
            fill="#000000"
            p-id="19355"
          />
        </svg>
      ),
      distributionMemory: (
        <svg
          t="1565779336591"
          className={styles.icon}
          viewBox="0 0 1099 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="1890"
          width="16"
          height="16"
        >
          <path
            d="M841.66 313.7 676.06 189.2c-3.7-2.8-8.1-4.3-12.7-4.3L277.56 185c-8.5 0-16.7 5.9-16.7 16.8l0 618.8c0 13.9 12 27.2 27.3 27.2l552.2 0c8.8 0 14.8-4.3 14.8-14.2L855.16 330.1C855.06 323.4 847.06 317.7 841.66 313.7zM682.36 257.7l0 124.5c0 4.9-2.4 9.2-7.8 9.2l-262 0c-7.2 0-8.2-3.8-8.2-9.5l0-145.1 248.4 0L682.36 257.7zM804.66 778.6c0 10.7-6.5 18-16.9 18l-461 0c-8.1 0.1-13.5-5.8-13.5-14.5L313.26 248.4c0-7.1 6.6-11.5 15.3-11.5 7.5 0 17 0 27.7 0l0.1 190.4c0 6.9 4.3 10.1 10.8 10.1l346.1-0.1c6.8 0.1 10.7-5 10.5-12.7l0.1-135.2 80.8 60.4L804.66 778.6zM371.56 621.2l188.7 0c6.7 0 11.2-4.3 11.2-10.4 0-5.2 0-20.1 0-25.7 0-6.6-7-10.8-13.2-10.8L370.16 574.3c-7.8 0-11.7 4.9-11.7 10.8 0 6.4 0 21.7 0 25.4C358.46 616.5 363.16 621.2 371.56 621.2zM709.86 574.3l-95 0c-8.2 0-14.1 4.7-14.1 11.3 0 4.7 0 19 0 23.8 0 8.1 6.3 11.9 13.6 11.9l94.3 0c8.4 0 15.2-5.9 15.2-13.2 0-6.2 0-11.8 0-18.9C723.96 581.2 718.46 574.3 709.86 574.3zM480.06 698.5 371.76 698.5c-8.3 0-13.4 4.3-13.4 13.3 0 6 0 12.2 0 17.3 0 8.9 5.4 14.4 13.7 14.4l105.6 0c7.9 0 15.1-5.3 15.1-14 0-6.7 0-11.6 0-16.3C492.76 705 486.06 698.5 480.06 698.5zM709.06 698.5 533.56 698.5c-8.9 0-14.2 6.5-14.2 14.1 0 4.4 0 12.5 0 17.3 0 6.2 5.6 13.6 14.5 13.6l174 0c8.9 0 16-6.3 16-15.4 0-4.1 0-8.7 0-14.9C723.96 704.8 718.66 698.5 709.06 698.5zM627.46 360.4c7.3 0 13.2-6.1 13.2-11.4L640.66 277.4c0-7.4-4.1-11.5-10.3-11.5-5.1 0-24.9 0-29.3 0-6.2 0-9.2 4.5-9.2 11.4l0 71.9c0 6.4 6.3 11.3 11.9 11.3C608.56 360.4 622.06 360.4 627.46 360.4z"
            p-id="1891"
          />
        </svg>
      ),
      useDisk: (
        <svg
          style={{ marginRight: '6px' }}
          t="1566640777774"
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="20451"
          width="15"
          height="14"
        >
          <path
            d="M615.7 82H67v860h890V368.4L615.7 82z m-317.1 50h298.9l2.1 1.7v214.9h-301V132zM724 892H298.6V642.6H724V892z m183 0H774V592.6H248.6V892H117V132h131.6v266.6h401v-223l257.5 216V892zM353.1 192.1h50v80h-50v-80z"
            p-id="20452"
          />
        </svg>
      ),
      version: (
        <svg
          t="1565853114924"
          className={styles.icon}
          viewBox="0 0 1184 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="6049"
          width="16"
          height="16"
        >
          <path
            d="M448.576 576l118.272 0q-8 90.272-56.288 142.016t-122.56 51.712q-92.576 0-145.44-66.272t-52.864-180.576q0-110.848 53.152-178.016t133.152-67.136q84.576 0 132.576 49.728t55.424 141.152l-116 0q-2.848-36.576-20.288-56.576t-46.56-20q-32.576 0-50.56 34.56t-18.016 101.44q0 27.424 2.848 48t10.272 39.712 22.848 29.44 37.728 10.272q54.272 0 62.272-79.424zM855.424 576l117.728 0q-8 90.272-56 142.016t-122.272 51.712q-92.576 0-145.44-66.272t-52.864-180.576q0-110.848 53.152-178.016t133.152-67.136q84.576 0 132.576 49.728t55.424 141.152l-116.576 0q-2.272-36.576-20-56.576t-46.272-20q-32.576 0-50.56 34.56t-18.016 101.44q0 27.424 2.848 48t10.272 39.712 22.56 29.44 37.44 10.272q28 0 43.712-21.728t19.136-57.728zM1060.576 508q0-118.272-8.864-175.424t-34.56-92q-3.424-4.576-7.712-8t-12.288-8.576-9.152-6.272q-49.152-36-398.272-36-357.152 0-405.728 36-2.848 2.272-10.016 6.56t-12 8-8.288 8.288q-25.728 34.272-34.272 91.136t-8.576 176.288q0 118.848 8.576 175.712t34.272 91.712q3.424 4.576 8.576 8.576t11.712 8 10.016 6.848q25.152 18.848 136.864 28t268.864 9.152q348.576 0 398.272-37.152 2.848-2.272 9.728-6.272t11.712-8 7.712-9.152q26.272-34.272 34.848-90.848t8.576-176.576zM1170.272 73.152l0 877.728-1170.272 0 0-877.728 1170.272 0z"
            p-id="6050"
          />
        </svg>
      ),
      warehouse: (
        <svg
          t="1567065405232"
          className={styles.icon}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="11295"
          width="16"
          height="16"
        >
          <path
            d="M960 448h-267.168a191.744 191.744 0 0 0-361.6 0H64v128h267.168a191.744 191.744 0 0 0 361.6 0H960z m-448 192a128 128 0 1 1 128-128 128 128 0 0 1-128 128z"
            fill="#000000"
            p-id="11296"
          />
        </svg>
      ),

      basicInfo: (
        <svg
          t="1567065519867"
          className={styles.iconm}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="18494"
          width="12"
          height="12"
        >
          <path
            d="M980.76306 840.106926c0 101.570274-82.384097 183.893074-183.893073 183.893074s-183.893074-82.322799-183.893074-183.893074c0-79.993487 51.367465-147.298352 122.595382-172.614298V349.725396c0-33.897623-27.400068-61.297691-61.297691-61.297691v61.236393a61.338556 61.338556 0 0 1-104.635159 43.398766l-122.595382-122.656681A61.032068 61.032068 0 0 1 429.083839 227.068716c0-15.630911 6.007174-31.32312 17.960224-43.27617l122.595382-122.595383A61.256826 61.256826 0 1 1 674.274604 104.473333V165.832322c101.508977 0 183.893074 82.322799 183.893074 183.893074v317.767232c71.227917 25.315946 122.595383 92.620812 122.595382 172.614298z m-183.893073-61.297691c-33.897623 0-61.297691 27.400068-61.297692 61.297691s27.400068 61.297691 61.297692 61.297691 61.297691-27.400068 61.297691-61.297691-27.400068-61.297691-61.297691-61.297691z m-429.083839 61.297691c0 101.570274-82.322799 183.893074-183.893074 183.893074s-183.893074-82.322799-183.893074-183.893074c0-79.993487 51.306168-147.298352 122.595383-172.614298V399.744312C51.306168 374.428366 0 307.1235 0 227.130013c0-101.570274 82.322799-183.893074 183.893074-183.893073s183.893074 82.322799 183.893074 183.893073c0 79.993487-51.306168 147.298352-122.595383 172.614299v267.687018c71.289215 25.377244 122.595383 92.682109 122.595383 172.675596zM183.893074 165.832322a61.297691 61.297691 0 1 0 0 122.595383 61.297691 61.297691 0 1 0 0-122.595383z m0 612.976913a61.297691 61.297691 0 1 0 0 122.595382 61.297691 61.297691 0 1 0 0-122.595382z"
            p-id="18495"
            fill="#000000"
          />
        </svg>
      ),
      branch: (
        <svg
          t="1567065220584"
          className={styles.icon}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="2245"
          width="16"
          height="16"
        >
          <path
            d="M863 192.050c0-63-51.3-114.3-114.3-114.3s-114.3 51.3-114.3 114.3c0 54.9 39.15 100.8 90.9 111.6-7.65 118.35-88.2 190.8-213.3 190.8-90.45 0-153 44.1-190.35 82.35v-272.7c52.2-10.8 91.35-56.7 91.35-112.050 0-63-51.3-114.3-114.3-114.3s-113.85 51.3-113.85 114.3c0 55.35 39.6 101.25 91.8 112.050v416.25c-52.2 10.35-91.8 56.7-91.8 112.050 0 63 51.3 114.3 114.3 114.3s113.85-51.75 113.85-114.75c0-55.35-39.6-101.25-91.8-112.050v-71.55c13.5-21.6 75.15-108.9 190.35-108.9 76.95 0 141.75-24.3 188.55-70.2 42.3-41.85 66.15-98.55 70.2-165.15 53.1-10.35 92.7-56.7 92.7-112.050zM229.85 192.050c0-38.25 31.050-69.3 69.3-69.3s69.3 31.050 69.3 69.3-31.050 69.3-69.3 69.3-69.3-31.050-69.3-69.3zM368 831.95c0 38.25-31.050 69.3-69.3 69.3s-69.3-31.050-69.3-69.3 31.050-69.3 69.3-69.3 69.3 31.050 69.3 69.3zM748.7 261.35c-38.25 0-69.3-31.050-69.3-69.3s31.050-69.3 69.3-69.3 69.3 31.050 69.3 69.3-31.050 69.3-69.3 69.3z"
            fill="#000000"
            p-id="2246"
          />
        </svg>
      ),
      logState: (
        <svg
          className={styles.icon}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="26201"
          width="16"
          height="16"
        >
          <path
            d="M951.509333 507.2L465.194667 993.514667c-0.682667 1.024-1.130667 2.176-2.026667 3.072a20.8 20.8 0 0 1-15.253333 5.994666 20.8 20.8 0 0 1-15.253334-5.994666c-0.896-0.896-1.322667-2.048-2.026666-3.072L73.066667 635.946667c-1.024-0.682667-2.154667-1.130667-3.072-2.026667A20.8 20.8 0 0 1 64 618.666667a20.693333 20.693333 0 0 1 5.994667-15.253334c0.917333-0.896 2.048-1.322667 3.072-2.026666L559.381333 115.093333A20.906667 20.906667 0 0 1 575.914667 106.666667h86.528c2.837333-32.042667 15.914667-60.16 35.626666-78.570667l0.341334 0.384c4.181333-4.416 9.877333-7.146667 16.170666-7.146667 12.629333 0 22.869333 10.922667 22.869334 24.384 0 8-3.84 14.741333-9.408 19.178667-10.218667 9.429333-17.493333 24.298667-19.925334 41.770667h102.464c6.826667 0 12.672 3.413333 16.533334 8.426666l124.373333 124.373334a20.992 20.992 0 0 1 8.426667 16.554666V490.666667a20.906667 20.906667 0 0 1-8.405334 16.533333z m-220.757333-151.658667a22.101333 22.101333 0 0 1-16.170667 7.125334c-12.629333 0-22.826667-10.922667-22.826666-24.384 0-8 3.84-14.741333 9.408-19.2 5.290667-4.885333 9.621333-11.456 13.162666-18.837334-18.24 4.864-31.744 21.333333-31.744 41.066667a42.666667 42.666667 0 0 0 85.333334 0c0-10.090667-3.626667-19.221333-9.493334-26.538667-13.12 33.002667-27.669333 40.768-27.669333 40.768z m186.496-91.413333L802.453333 149.333333h-89.877333c3.712 9.472 9.045333 17.536 15.466667 23.466667 0.874667 0.704 1.962667 1.130667 2.709333 1.962667l0.384-0.384c22.208 20.757333 36.8 53.504 36.8 90.752 0 0.896-0.213333 1.685333-0.256 2.56 25.536 14.741333 42.922667 42.026667 42.922667 73.642666a85.333333 85.333333 0 0 1-170.666667 0 85.141333 85.141333 0 0 1 81.493333-84.949333c-1.92-18.944-9.408-35.157333-20.245333-45.184-0.874667-0.704-1.962667-1.130667-2.752-1.962667l-0.341333 0.384C682.218667 194.794667 670.506667 173.674667 664.96 149.333333h-80.917333l-469.333334 469.333334 333.205334 333.205333 469.333333-469.333333V264.128zM304.682667 582.08a20.842667 20.842667 0 0 1 29.461333 0l150.378667 150.378667a20.842667 20.842667 0 0 1-29.461334 29.461333l-150.378666-150.378667a20.842667 20.842667 0 0 1 0-29.461333z m85.333333-85.333333a20.842667 20.842667 0 0 1 29.461333 0l150.357334 150.378666a20.842667 20.842667 0 0 1-29.461334 29.461334l-150.357333-150.378667a20.842667 20.842667 0 0 1 0-29.461333z"
            fill={color || '#000'}
            p-id="26202"
          />
        </svg>
      ),
      createTime: (
        <svg
          t="1567066044003"
          className={styles.icon}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="4001"
          width="16"
          height="16"
        >
          <path
            d="M720.32 257.344l-403.648-0.576a21.632 21.632 0 1 1 0-43.2l403.648 0.512a21.632 21.632 0 0 1 0 43.264z"
            p-id="4002"
            fill="#000000"
          />
          <path
            d="M882.88 921.344H143.808c-33.6 0-57.152-19.584-57.152-47.68V261.76c0-27.968 24-48.192 57.152-48.192H212.48a21.632 21.632 0 1 1 0 43.264H143.808c-6.528 0-13.824 2.112-13.824 4.992v611.968c0.64 1.728 5.248 4.416 13.824 4.416h739.072a11.136 11.136 0 0 0 11.136-11.136v-599.04a11.136 11.136 0 0 0-11.136-11.136h-71.488a21.632 21.632 0 0 1 0-43.264h71.488a54.4 54.4 0 0 1 54.4 54.4v599.04a54.4 54.4 0 0 1-54.4 54.272z"
            p-id="4003"
            fill="#000000"
          />
          <path
            d="M915.648 413.568H114.816a21.632 21.632 0 1 1 0-43.264h800.768a21.632 21.632 0 0 1 0.064 43.264zM264.576 309.44a21.632 21.632 0 0 1-21.632-21.632V170.624a21.632 21.632 0 1 1 43.264 0v117.184a21.632 21.632 0 0 1-21.632 21.632zM772.352 309.44a21.568 21.568 0 0 1-21.632-21.632V170.624c0-11.968 9.6-21.632 21.632-21.632s21.632 9.664 21.632 21.632v117.184c0 11.968-9.6 21.632-21.632 21.632zM416.512 504.384c51.712 0 82.624 30.08 82.624 75.264 0 92.608-143.232 119.616-143.232 165.888h134.72a12.032 12.032 0 0 1 0 24.064H341.632a12.096 12.096 0 0 1-11.968-12.032c0-84.928 143.616-94.144 143.616-177.856 0-29.824-20.096-52.16-56.768-52.16-32 0-45.952 16.256-54.784 35.52-2.368 4.992-6.144 7.744-11.2 7.744a12.032 12.032 0 0 1-11.2-16.256c10.432-31.296 37.44-50.176 77.184-50.176zM539.648 690.816c0-33.28 16.96-57.856 45.504-68.672-17.28-9.28-33.984-25.472-33.984-56 0-46.272 32.064-67.072 78.72-67.072 46.72 0 78.72 20.8 78.72 67.072 0 30.592-16.576 46.72-33.984 56 28.608 10.816 45.632 35.456 45.632 68.672 0 52.48-36.672 78.72-90.368 78.72-53.568 0-90.24-26.24-90.24-78.72z m25.472 0c0 38.656 26.624 55.616 64.832 55.616s64.96-17.024 64.96-55.616c0-38.272-24.448-55.936-64.96-55.936s-64.832 17.664-64.832 55.936z m11.648-124.672c0 30.592 20.8 45.568 53.184 45.568 32.448 0 53.312-14.976 53.312-45.568 0-29.696-20.032-43.968-53.312-43.968-33.216 0-53.184 14.272-53.184 43.968z"
            p-id="4004"
            fill="#000000"
          />
        </svg>
      ),
      currentVersion: (
        <svg
          style={{
            cursor: 'pointer'
          }}
          t="1566532978509"
          className={styles.icon}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="10598"
          width="16"
          height="16"
        >
          <path
            d="M512 42.666667C251.733333 42.666667 42.666667 251.733333 42.666667 512s209.066667 469.333333 469.333333 469.333333 469.333333-209.066667 469.333333-469.333333S772.266667 42.666667 512 42.666667z m0 874.666666C288 917.333333 106.666667 736 106.666667 512S288 106.666667 512 106.666667s405.333333 181.333333 405.333333 405.333333-181.333333 405.333333-405.333333 405.333333z"
            p-id="10599"
            fill="#1296db"
          />
          <path
            d="M544 279.466667c-10.666667 10.666667-14.933333 23.466667-14.933333 40.533333 0 12.8 4.266667 23.466667 12.8 32 8.533333 8.533333 19.2 12.8 32 12.8 10.666667 0 23.466667-2.133333 38.4-17.066667 10.666667-10.666667 14.933333-25.6 14.933333-40.533333 0-12.8-4.266667-23.466667-12.8-32-19.2-19.2-51.2-17.066667-70.4 4.266667zM556.8 644.266667c-14.933333 14.933333-25.6 23.466667-34.133333 29.866666 4.266667-19.2 12.8-57.6 34.133333-130.133333 21.333333-72.533333 23.466667-87.466667 23.466667-91.733333 0-10.666667-4.266667-21.333333-12.8-27.733334-17.066667-14.933333-49.066667-12.8-87.466667 10.666667-21.333333 12.8-44.8 32-68.266667 59.733333l-12.8 14.933334 44.8 34.133333 10.666667-10.666667c12.8-12.8 21.333333-19.2 25.6-25.6-34.133333 110.933333-49.066667 179.2-49.066667 209.066667 0 14.933333 4.266667 25.6 12.8 34.133333 8.533333 8.533333 19.2 12.8 32 12.8s27.733333-4.266667 44.8-14.933333c17.066667-8.533333 40.533333-29.866667 74.666667-61.866667l12.8-12.8-40.533333-38.4-10.666667 8.533334z"
            p-id="10600"
            fill="#1296db"
          />
        </svg>
      ),
      upgrade: (
        <svg
          style={{
            cursor: 'pointer'
          }}
          t="1566533552365"
          className={styles.icon}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="11396"
          width="16"
          height="16"
        >
          <path
            d="M512 57.6c249.6 0 454.4 204.8 454.4 454.4s-204.8 454.4-454.4 454.4S57.6 761.6 57.6 512 262.4 57.6 512 57.6M512 0C230.4 0 0 230.4 0 512s230.4 512 512 512 512-230.4 512-512-230.4-512-512-512z"
            p-id="11397"
            fill="#000000"
          />
          <path
            d="M326.4 492.8l160-160v428.8c0 19.2 12.8 32 32 32s32-12.8 32-32V332.8l160 160c12.8 12.8 32 12.8 44.8 0s12.8-32 0-44.8L531.2 243.2s-6.4-6.4-12.8-6.4h-25.6c-6.4 0-6.4 6.4-12.8 6.4L281.6 448c-12.8 12.8-12.8 32 0 44.8s32 12.8 44.8 0z"
            p-id="11398"
            fill="#000000"
          />
        </svg>
      ),
      rollback: (
        <svg
          style={{
            cursor: 'pointer'
          }}
          t="1566533701108"
          className={styles.icon}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="14118"
          width="16"
          height="16"
        >
          <path
            d="M416 640V384H512v185.6l115.2 32-25.6 89.6-185.6-51.2zM512 102.4c243.2 0 448 198.4 448 448s-198.4 448-448 448-448-198.4-448-448c0-89.6 19.2-172.8 76.8-243.2l64 44.8c-38.4 57.6-57.6 128-57.6 198.4 0 198.4 166.4 364.8 364.8 364.8s364.8-166.4 364.8-364.8S710.4 185.6 512 185.6v102.4L326.4 147.2 512 0v102.4z"
            p-id="14119"
            fill="#000000"
          />
        </svg>
      ),
      delete: (
        <svg
          style={{
            cursor: 'pointer'
          }}
          t="1566533607654"
          className={styles.icon}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="11648"
          width="16"
          height="16"
        >
          <path
            d="M950.857143 219.428571h-182.857143V73.142857h-512v146.285714H73.142857v73.142858h109.714286v658.285714h658.285714V292.571429H950.857143V219.428571zM329.142857 146.285714h365.714286v73.142857h-365.714286V146.285714z m438.857143 731.428572h-512V292.571429h146.285714v438.857142h73.142857V292.571429h73.142858v438.857142h73.142857V292.571429h146.285714v585.142857z"
            p-id="11649"
            fill="#000000"
          />
        </svg>
      ),
      success: (
        <svg
          className={styles.icon}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="31270"
          width="16"
          height="16"
        >
          <path
            d="M927.97968 108.360629a50.575037 50.575037 0 0 0-69.085501 18.517689l-391.898737 678.933747-316.000056-182.409708A50.575037 50.575037 0 0 0 100.427574 711.005546l359.812488 207.690002a50.553362 50.553362 0 0 0 69.078276-18.517689L946.504593 177.44613a50.575037 50.575037 0 0 0-18.524913-69.085501z"
            fill="#46AF60"
            p-id="31271"
          />
        </svg>
      ),
      error: (
        <svg
          className={styles.icon}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="32079"
          width="16"
          height="16"
        >
          <path
            d="M 909.812 962.028 c -13.094 0 -26.188 -4.996 -36.179 -14.987 L 73.958 147.368 c -19.98 -19.98 -19.98 -52.378 0 -72.359 c 19.983 -19.98 52.38 -19.98 72.36 0 L 945.99 874.683 c 19.981 19.981 19.981 52.378 0 72.36 c -9.99 9.99 -23.084 14.985 -36.179 14.985 Z"
            fill="#db4545"
            p-id="32080"
          />
          <path
            d="M 110.138 962.028 c -13.094 0 -26.188 -4.996 -36.179 -14.987 c -19.98 -19.98 -19.98 -52.378 0 -72.359 L 873.632 75.01 c 19.982 -19.98 52.377 -19.98 72.36 0 c 19.98 19.981 19.98 52.378 0 72.36 L 146.316 947.041 c -9.99 9.99 -23.084 14.986 -36.179 14.986 Z"
            fill="#db4545"
            p-id="32081"
          />
        </svg>
      ),
      close: (
        <svg
          className={styles.icon}
          viewBox="0 0 1024 1024"
          version="1.1"
          xmlns="http://www.w3.org/2000/svg"
          p-id="43063"
          width="16"
          height="16"
        >
          <path
            d="M511.998049 66.069397c-246.273427 0-445.926662 199.653235-445.926662 445.926462s199.653035 445.931458 445.926662 445.931458c246.296411 0 445.926462-199.658032 445.926462-445.931458S758.29446 66.069397 511.998049 66.069397zM511.998049 920.100164c-225.395582 0-408.104305-182.709523-408.104305-408.104305 0-225.395582 182.708723-408.105305 408.104305-408.105305 225.41357 0 408.125291 182.709723 408.125291 408.105305C920.12334 737.410428 737.411619 920.100164 511.998049 920.100164zM816.163025 803.452451 233.172693 196.400632l-25.336822 23.633976 583.593923 607.556477L816.163025 803.452451z"
            p-id="43064"
            fill="#9d9d9d"
          />
        </svg>
      )
    };
    return svgType[type] || type;
  },
  fetchStateBJColor(status) {
    const statusColorMap = {
      running:
        'linear-gradient(to right, #00D777 0, #00D777 10px, #fff 10px, #fff 100%) no-repeat', // 运行中 绿色
      starting:
        'linear-gradient(to right, #F69D4A 0, #F69D4A 10px, #fff 10px, #fff 100%) no-repeat', // 启动中
      checking:
        'linear-gradient(to right, #F69D4A 0, #F69D4A 10px, #fff 10px, #fff 100%) no-repeat', // 检测中
      stopping:
        'linear-gradient(to right, #20124A 0, #20124A 10px, #fff 10px, #fff 100%) no-repeat', // 关闭中 紫色
      unusual:
        'linear-gradient(to right, #CD0200 0, #CD0200 10px, #fff 10px, #fff 100%) no-repeat', // 异常
      closed:
        'linear-gradient(to right, #000021 0, #000021 10px, #fff 10px, #fff 100%) no-repeat', // 已关闭
      undeploy:
        'linear-gradient(to right, #708090 0, #708090 10px, #fff 10px, #fff 100%) no-repeat', // 未部署 石板灰
      unKnow:
        'linear-gradient(to right, #CD0200 0, #CD0200 10px, #fff 10px, #fff 100%) no-repeat', // 未知
      upgrade:
        'linear-gradient(to right, #00FF4A 0, #00FF4A 10px, #fff 10px, #fff 100%) no-repeat', // 升级中
      creating:
        'linear-gradient(to right, #778899 0, #778899 10px, #fff 10px, #fff 100%) no-repeat', // 部署中
      expired:
        'linear-gradient(to right, #CD0200 0, #CD0200 10px, #fff 10px, #fff 100%) no-repeat' // 过期
    };
    return statusColorMap[status] || statusColorMap.unKnow;
  },
  fetchStateText(state) {
    const statusColorMap = {
      RUNNING: '运行中',
      running: '运行中',
      starting: '启动中',
      checking: '检测中',
      stopping: '关闭中',
      unusual: '运行异常',
      closed: '已关闭',
      undeploy: '未部署',
      unKnow: '未知',
      UNKNOWN: '未知',
      ABNORMAL: '运行异常',
      TEMINATING: '关闭中',
      INITIATING: '等待启动',
      SCHEDULING: '调度中',
      TheInternet: '未知',
      upgrade: '升级中',
      creating: '部署中',
      expired: '过期',
      NOTREADY: '未就绪',
      UNHEALTHY: '不健康'
    };
    return statusColorMap[state] || statusColorMap.TheInternet;
  },
  fetchGovernanceMode(state) {
    const GovernanceMode = {
      KUBERNETES_NATIVE_SERVICE: '原生 service 模式',
      BUILD_IN_SERVICE_MESH: '内置 ServiceMesh 模式'
    };
    return GovernanceMode[state] || '-';
  },
  fetchTime(value) {
    const second = value; // 时间差的毫秒数
    let result = '';

    // 计算出相差天数
    const days = Math.floor(second / (24 * 3600 * 1000));

    // 计算出小时数

    const leave1 = second % (24 * 3600 * 1000); // 计算天数后剩余的毫秒数
    const hours = Math.floor(leave1 / (3600 * 1000));
    // 计算相差分钟数
    const leave2 = leave1 % (3600 * 1000); // 计算小时数后剩余的毫秒数
    const minutes = Math.floor(leave2 / (60 * 1000));

    // 计算相差秒数
    const leave3 = leave2 % (60 * 1000); // 计算分钟数后剩余的毫秒数
    const seconds = Math.round(leave3 / 1000);

    if (days && days >= 1) {
      result += `${days}天`;
    }
    if (hours && hours >= 1) {
      result += `${hours}小时`;
    }

    if (minutes && minutes >= 1) {
      result += `${minutes}分钟`;
    }

    if (seconds && seconds >= 1) {
      result += `${seconds}秒`;
    }
    return result || '1秒';
  },
  fetchdayTime(date) {
    const second = Date.parse(new Date()) - new Date(date).getTime();
    // 计算出相差天数
    const days = Math.floor(second / (24 * 3600 * 1000));
    // 计算出小时数

    const leave1 = second % (24 * 3600 * 1000); // 计算天数后剩余的毫秒数
    const hours = Math.floor(leave1 / (3600 * 1000));
    // 计算相差分钟数
    const leave2 = leave1 % (3600 * 1000); // 计算小时数后剩余的毫秒数
    const minutes = Math.floor(leave2 / (60 * 1000));

    // 计算相差秒数
    const leave3 = leave2 % (60 * 1000); // 计算分钟数后剩余的毫秒数
    const seconds = Math.round(leave3 / 1000);

    let result = '';
    if (days && days > 7) {
      result = moment(date)
        .locale('zh-cn')
        .format('YYYY-MM-DD');
    } else if (days && days >= 1 && days < 7) {
      result += `${days}天前`;
    } else if (hours && hours >= 1 && hours <= 23) {
      result += `${hours}小时前`;
    } else if (minutes && minutes >= 1 && minutes <= 59) {
      result += `${minutes}分钟前`;
    } else if (seconds && seconds >= 1 && seconds <= 59) {
      result += `${seconds}秒前`;
    } else {
      result = '1秒前';
    }
    return result;
  },
  fetchInstanceReasons(type) {
    const reasonsType = {
      UnknownContainerStatuses: '未知的容器状态',
      ContainersNotReady: '容器未就绪',
      ContainersNotInitialized: '容器尚未初始化'
    };
    return reasonsType[type] || type;
  },
  fetchInstanceAdvice(type) {
    const adviceType = {
      OutOfMemory:
        '内存不足, 建议为程序分配更多内存, 或检查程序是否合理使用内存',
      Unhealthy:
        '健康检测不通过, 请检查程序的端口是否可用, 以及健康检测配置是否正确',
      Initiating: '等待启动中, 请检查该组件所依赖的组件是否已经正常启动'
    };
    return adviceType[type] || type;
  },
  fetchOperation(finalstatus, status) {
    if (finalstatus == '') {
      return (
        <span style={{ color: '#F69C49', paddingLeft: '5px' }}>进行中</span>
      );
    }
    if (
      finalstatus == 'timeout' ||
      (finalstatus == 'complete' && status == 'timeout')
    ) {
      return <span style={{ color: 'rgba(0, 0, 0, 0.65)' }}>操作已超时</span>;
    }

    if (finalstatus == 'empty' || finalstatus == 'emptycomplete') {
      return <span />;
    }
    switch (status) {
      case 'success':
        return <span style={{ color: '#39AA56' }}>成功</span>;
      case 'failure':
        return <span style={{ color: '#F5212D' }}>失败</span>;
    }
  },
  fetchAccessText(text) {
    const AccessText = {
      component: '组件管理',
      app: '应用管理',
      gatewayRule: '网关访问策略',
      certificate: '证书管理',
      plugin: '插件管理',
      teamMember: '部门成员管理',
      teamRole: '部门角色管理',
      teamRegion: '部门服务群管理'
    };
    return AccessText[text] || text;
  },
  fetchAbnormalcolor(type) {
    const abnormalcolor = {
      AbnormalRecovery: '#39AA56',
      OOMKilled: '#CD0200',
      LivenessProbeFailed: '#CD0200',
      ReadinessProbeFailed: '#CD0200',
      AbnormalShtdown: '#CD0200',
      EventTypeAbnormalExited: '#CD0200',
      AbnormalExited: '#CD0200'
    };
    return abnormalcolor[type] || 'rgba(0,0,0,0.65)';
  },
  fetchStateOptTypeText(state) {
    const statusOptType = {
      deploy: '构建组件',
      delete: '删除组件',
      HorizontalUpgrade: '水平升级',
      VerticalUpgrade: '垂直升级',
      create: '创建组件',
      callback: '回滚',
      'git-change': '代码仓库修改',
      own_money: '欠费关闭',
      add_label: '添加标签',
      delete_label: '删除标签',
      service_state: '应用状态修改',
      reboot: '重启组件',
      market_sync: '云市同步',
      truncate: '删除组件',
      EventTypeAbnormalExited: '组件异常退出',
      OOMKilled: '发生OOM',
      LivenessProbeFailed: '健康检查不通过(重启)',
      ReadinessProbeFailed: '健康检查不通过(下线)',
      AbnormalShtdown: ' 组件异常退出',
      AbnormalExited: '组件异常退出',
      AbnormalRecovery: '恢复正常',
      '': '-',
      'create-service': '创建组件',
      'batch-build-service': '批量构建组件',
      'batch-start-service': '批量启动组件',
      'batch-stop-service': '批量停止组件',
      'batch-upgrade-service': '批量升级组件',
      'build-service': '构建组件',
      build: '构建组件',
      upgrade: '滚动升级组件',
      'update-service': '更新组件部署类型',
      'start-service': '启动组件',
      start: '启动组件',
      'add-app-autoscaler-rule': '添加自动伸缩规则',
      'update-app-autoscaler-rule': '更新自动伸缩规则',
      'stop-service': '停止组件',
      stop: '停止组件',
      'restart-service': '重启组件',
      restart: '重启组件',
      'vertical-service': '垂直扩展组件',
      vertical: '垂直扩展组件',
      'horizontal-service': '水平扩展组件',
      horizontal: '水平扩展组件',
      'set-language': '设置组件语言',
      'delete-service': '删除组件',
      'upgrade-service': '升级组件',
      'delete-buildversion': '删除构建版本',
      'share-service': '发布组件',
      'share-wb': '发布到内部市场',
      'share-ws': '发布到云端市场',
      'share-yb': '发布到市场',
      'share-ys': '发布到市场',
      updata: '更新组件',
      'add-app-service-monitor': '添加监控点',
      'add-service-dependency': '添加组件依赖',
      'delete-service-dependency': '删除组件依赖',
      'add-service-env': '添加组件环境变量',
      'update-service-env': '更新组件环境变量',
      'delete-service-env': '删除组件环境变量',
      'add-service-port': '添加组件端口',
      'update-service-port-old': '更新组件端口',
      'update-service-port': '更新组件端口',
      'delete-service-port': '删除组件端口',
      'handle-service-outerport': '修改组件对外端口',
      'handle-service-innerport': '修改组件对内端口',
      'change-service-lbport': '修改组件LB端口',
      'rollback-service': '回滚',
      'add-service-volume': '添加组件持久化存储',
      'update-service-volume': '更新组件持久化存储',
      'delete-service-volume': '删除组件持久化存储',
      'add-service-depvolume': '添加组件依赖存储',
      'delete-service-depvolume': '删除组件依赖存储',
      'add-service-probe': '添加组件探针',
      'update-service-probe': '更新组件探针',
      'delete-service-probe': '删除组件探针',
      'add-service-label': '添加组件标签',
      'update-service-label': '更新组件标签',
      'delete-service-label': '删除组件标签',
      'add-thirdpart-service': '添加第三方组件',
      'update-thirdpart-service': '更新第三方组件',
      'delete-thirdpart-service': '删除第三方组件',
      'update-service-gateway-rule': '更新组件网关规则',
      'app-restore-envs': '重新加载应用环境变量',
      'app-restore-ports': '重新加载应用端口',
      'app-restore-volumes': '重新加载应用存储',
      'app-restore-probe': '重新加载应用探针',
      'app-restore-deps': '重新加载应用依赖',
      'app-restore-depvols': '重新加载应用依赖存储',
      'app-restore-plugins': '重新加载应用插件',
      'create-service-plugin': '创建组件插件',
      'update-service-plugin': '更新组件插件',
      'delete-service-plugin': '删除组件插件',
      'update-service-plugin-config': '更新组件插件配置'
    };
    return statusOptType[state] || state;
  },
  replaceUrlTeam(team) {
    let { href } = location;
    const reg = /team\/([^/]+)/;
    href = href.replace(reg, (string, g1) =>
      string.replace(new RegExp(g1), team)
    );
    return href;
  },
  replaceUrlRegion(region) {
    let { href } = location;
    const reg = /region\/([^/]+)/;
    href = href.replace(reg, (string, g1) =>
      string.replace(new RegExp(g1), region)
    );
    return href;
  },
  replaceUrlTeamAndTegion(team, region) {
    let { href } = location;
    const reg = /team\/([^/]+)\/region\/([^/]+)/;
    href = href.replace(reg, (string, g1, g2) =>
      string.replace(new RegExp(g1), team).replace(new RegExp(g2), region)
    );
    return href;
  },
  getSupportComponentTyps() {
    return [
      {
        type: 'state_singleton',
        name: this.getComponentType('state_singleton'),
        desc: '部署为Statefulset类型，一般用于DB类，消息中间件类，数据类组件 '
      },
      {
        type: 'state_multiple',
        name: this.getComponentType('state_multiple'),
        desc: '可多实例运行的有状态组件'
      },
      {
        type: 'stateless_singleton',
        name: this.getComponentType('stateless_singleton'),
        desc: '部署为Deployment, 一般用于Web类，API类等组件，不可扩展实例数'
      },
      {
        type: 'stateless_multiple',
        name: this.getComponentType('stateless_multiple'),
        desc: '可多实例运行的无状态组件'
      }
    ];
  },
  getComponentType(componentType) {
    switch (componentType) {
      case 'state_singleton':
        return '有状态单实例';
      case 'state_multiple':
        return '有状态多实例';
      case 'stateless_singleton':
        return '无状态单实例';
      case 'stateless_multiple':
        return '无状态多实例';
      default:
        return '';
    }
  },
  isStateComponent(componentType) {
    if (
      componentType === 'state_singleton' ||
      componentType === 'state_multiple'
    ) {
      return true;
    }
    return false;
  },
  isSingletonComponent(componentType) {
    if (
      componentType === 'state_singleton' ||
      componentType === 'stateless_singleton'
    ) {
      return true;
    }
    return false;
  }
};

export default global;
